/*
 * EquipmentType.h
 *
 *  Created on: Oct 8, 2011
 *  Created by: Devin Manno
 *  Updated by: Devin Manno, Nick James
 *	Last Update: Nov 14, 2011
 */

#ifndef EQUIPMENTTYPE_H_
#define EQUIPMENTTYPE_H_

#include "Stats.h"
#include "Base.h"
#include <ctime>
#include <cstdlib>
#include <vector>
#include <iostream>
#include <string.h>

#define DELIMS ",\n"
#define MAX 250

using std::string;
using std::ostream;
using std::istream;
using std::endl;

enum itemSlot { HEAD, CHEST, GLOVES, FEET, PANTS, WEAPON };

class EquipmentType: public Base {
private:
	itemSlot itemType;			// based on itemSlot, above
	Stats itemStats;			// the item's stats
	bool placeholder; 			// true if the equipmentType is just a placeholder with 0 stats

	// setters
	void generate(int, int);		// sets stats for ItemStats
	void makePlaceholder(); 	// clear all stats and make equipment a placeholder item
	void generateHelmet();		// generates a helmet
	void generateChest();		// generates chest armor
	void generateGloves();		// generates gloves
	void generateBoots();		// generates boots
	void generatePants();		// generates pants
	void generateWeapon();		// generates a weapon
    

	// friend functions
    friend std::ostream& operator<<(std::ostream& out, EquipmentType& e);
    friend std::istream& operator>>(std::istream&, EquipmentType&);

public:
	static const int maxSlots = 6;		// maximum number of equipment items a character can wear/use at once
	static const int maxBoost = 10;		// maximum value for any individual stat in an equipment
    
	EquipmentType(); // randomly create an EquipmentType object
	EquipmentType(itemSlot); // create a specific EquipmentType object
	EquipmentType(itemSlot whichSlot, bool placeholderOnly); // create a specific EuipmentType object with 0 stats if placeholderOnly == true
    
	virtual ~EquipmentType();
	
	// getters
	int getItemType() const; // returns the type of the equipment based on itemSlot
	const Stats &getItemStats() const;
	const bool isPlaceholder(); 	// returns placeholder
};

#endif /* EQUIPMENTTYPE_H_ */
